MacHTTP: CGI

CGI (Common Gateway Interface) is a means for MacHTTP to communicate with other applications to get specialized information for the client. It uses an AppleEvent (WWW*sdoc) to send information about the URL request to the application, and gets information about what to send to the client in the form of a reply to the AppleEvent.
An AppleScript application would begin like this:

on <<event WWW*sdoc>> path_args \

given <<class kfor>>:http_search_args, <<class addr>>:client_address, <<class user>>:username, <<class pass>>:password

[ '*' is Omega: option-z, '<<' is option-\, '>>' is option-shift-\, '\' is a soft return (line continues next line): option-return]

This responds to an AppleEvent of type WWW*sdoc and extracts the parameters from the event.

>From Chuck's 'search_script.cgi' AppleScript (included with MacHTTP 1.3.1beta and later):

This is WEIRD syntax. What it really means is that you have the variables path_args, http_search_args, client_address, username, and password to play with. They are all strings.

gneufeld -- 7/18/94

MacHTTP Contents